import java.io.*;
import java.util.*;
import java.net.*;

class Test{
	public static void main(String[] args) throws IOException {
		Scanner scanner=new Scanner(System.in);
		while(true) {
			System.out.print("Enter url: ");
			String input=scanner.nextLine();
			if(input.length()==0) {
				System.out.println("Exit");
				break;
			}

			URL url=new URL(input);
			Scanner urlScanner=new Scanner(url.openStream());
			while(urlScanner.hasNext()) {
				System.out.println(urlScanner.nextLine());
			}
		}
	}
}
